{% extends 'cms/base.html' %}
{% block title %}
    版主管理
{% endblock %}
{% block head %}
    <style>.modal-backdrop{z-index:0;}</style>
    <script src="{{ url_for('static', filename='cms/js/mod_board_manager.js') }}"></script>
{% endblock %}
{% block page_title %}
    版主管理
{% endblock %}
{% block main_content %}
    <table class="table table-bordered">
        <thead>
        <tr>
            <th>板块</th>
            <th>版主</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        <style>
            {#.board-manage:hover {#}
            {#    background-color: #d9534f;#}
            {#    cursor: pointer;#}
            {#    padding: 5px;#}
            {#    zoom: 1.1;#}
            {#    border-radius: 3px;#}
            {#}#}
        </style>
        {% for board in boards %}
            <tr>
                <td>{{ board.name }}</td>
                <td>
                    {% for board_manage in board.board_manages %}
                        <span bmid="{{ board_manage[1] }}" class="board-manager-name">{{ board_manage[0] }}

                        </span>
                    {% endfor %}

                </td>
                <td>
                    <button bdid="{{ board.id }}" bdname="{{ board.name }}" class="btn btn-success board-manager-add-btn" data-toggle="modal" data-target="#board_manager_manage_modal">添加版主</button>
                </td>
            </tr>
        {% endfor %}
        </tbody>
    </table>

        <!-- Modal -->

    <div class="modal fade" id="board_manager_manage_modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                            aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="myModalLabel">添加版主</h4>
                </div>
                <div class="modal-body">
                    <form action="" class="form-horizontal">
                        <div class="form-group">
                            <label for="" class="control-label col-sm-2">用户名</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" name="username">
                            </div>
                        </div>

                        <div class="form-group">
                            <label for="" class="control-label col-sm-2">所属板块</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" name="board">
                            </div>
                        </div>

                    </form>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                    <button type="button" class="btn btn-primary save-board-manage-btn">保存</button>
                </div>
            </div>
        </div>
    </div>
{% endblock %}